<?php

class Application_Model_UserAddress
{
	protected $_id;
	protected $_userid;
	protected $_name;
	protected $_mobil_tel;
	protected $_home_tel;
	protected $_country;
	protected $_province;
	protected $_city;
	protected $_district;
	protected $_address;
	protected $_zip_code;
	protected $_longitude;
	protected $_latitude;
	

	public function __construct(array $options = null)
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid user property');
		}
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid user property');
		}
		return $this->$method();
	}
	
	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	
	public function setId($id){
		$this->_id = $id;
		return $this;
	}
	
	public function getId(){
		return $this->_id;
	}
	
	public function setUserId($udi){
		$this->_userid = $udi;
		return $this;
	}
	
	public function getUserId(){
		return $this->_userid;
	}
	
	public function setName($name){
		$this->_name = $name;
		return $this;
	}
	
	public function getName(){
		return $this->_name;
	}
	
	public function setMobileTel($mobile){
		$this->_mobil_tel = $mobile;
		return $this;
	}
	
	public function getMobileTel(){
		return $this->_mobil_tel;
	}
	
	public function setHomeTel($home){
		$this->_home_tel = $home;
		return $this;
	}
	
	public function getHomeTel(){
		return $this->_home_tel;
	}
	
	public function setCountry($country){
		$this->_country = $country;
		return $this;
	}
	
	public function getCountry(){
		return $this->_country;
	}
	
	public function setProvince($province){
		$this->_province = $province;
		return $this;
	}
	
	public function getProvince(){
		return $this->_province;
	}
	
	public function setCity($city){
		$this->_city = $city;
		return $this;
	}
	
	public function getCity(){
		return $this->_city;
	}
	
	public function setDistrict($district){
		$this->_district = $district;
		return $this;
	}
	
	public function getDistrict(){
		return $this->_district;
	}
	
	public function setAddress($address){
		$this->_address = $address;
		return $this;
	}
	
	public function getAddress(){
		return $this->_address;
	}
	
	public function setZipCode($zipcode){
		$this->_zip_code = $zipcode;
		return $this;
	}
	
	public function getZipCode(){
		return $this->_zip_code;
	}
	
	public function setLongitude($longitude){
		$this->_longitude = $longitude;
		return $this;
	}
	
	public function getLongitude(){
		return $this->_longitude;
	}
	
	public function setLatitude($latitude){
		$this->_latitude = $latitude;
		return $this;
	}
	
	public function getLatitude(){
		return $this->_latitude;
	}
	


}

